package com.appcheck.recording.handler.action;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.appcheck.recording.action.ActionConvert;
import com.appcheck.recording.plugin.AbstractActionConverter;


public final class GestureAction implements ActionConvert{
	private int dragTime;
	private ArrayList<Point> points;
	public GestureAction(){
		this.points = new ArrayList();
	}
	public final String toString(){
	    JSONObject localJSONObject = new JSONObject();
	    try
	    {
	      localJSONObject.put("class", "GestureAction");
	      localJSONObject.put("dragTime", this.dragTime);
	      localJSONObject.put("points", toJSONArray());
	    }
	    catch (JSONException localJSONException) {}
	    return localJSONObject.toString();

	}
	
	public final void setDragTime(int dragTime) {
		this.dragTime = dragTime;
	}
	public final void setPoints(ArrayList<Point> points) {
		this.points = points;
	}
	private JSONArray toJSONArray(){
		JSONArray localJSONArray = new JSONArray();
		for(Point point : this.points){
			localJSONArray.put(point.toJSONObject());
		}
		return localJSONArray;
	}
	@Override
	public void toTestCode(AbstractActionConverter actionConverter) {

	}
}
